const proxy = require('http-proxy-middleware')

module.exports = function (app) {
  app.use(proxy('/api', {
    target: 'http://localhost/',
    changeOrigin: true,
    timeout: 10000
  }))
  app.use(proxy('/socket.io', {
    target: 'http://localhost/',
    changeOrigin: true,
    timeout: 10000,
    ws: true // 代理webSocket
  }))
}